package com.example.anitamusicspace.service;

import com.example.anitamusicspace.mapper.MusicMapper;
import com.example.anitamusicspace.mapper.UserMapper;
import com.example.anitamusicspace.model.Music;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 小梅就是酱子
 * Date: 2022-08-25
 * Time: 20:17
 */
@Service
public class MusicService {
    @Resource
    private MusicMapper musicMapper;

    public int insert(String title,String singer,String time,String url,int userid){
        return musicMapper.insert(title,singer,time,url,userid);
    }

    public List<Music> findMusicByMusicNameAndSinger(String title){
        return musicMapper.findMusicByMusicNameAndSinger(title);
    }

    public Music findMusicById(int id){
        return musicMapper.findMusicById(id);
    }

    public int deleteMusicById(int musicId){
        return musicMapper.deleteMusicById(musicId);
    }


    public List<Music> findMusic(){
        return musicMapper.findMusic();
    }


    public List<Music> findMusicByMusicName(String name){
        return musicMapper.findMusicByMusicName(name);
    }
}
